-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Asset Loop out #872
Conversation
5e35488
to
fd87cb9
Compare
ultimate deliverable for asset specification will need to be specification by group_key, rather that asset_id only |
50a927f
to
5b60e68
Compare
df72fdc
to
8696132
Compare
8696132
to
abf4549
Compare
@bhandras: review reminder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @sputn1ck, this seems pretty straight forward.
I've got mostly minor comments in my first pass. Will take a look at the int test.
db8949c
to
3315e2d
Compare
82fa50a
to
242d754
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! 🔥 Looks pretty good!
-- name: UpdateLoopOutAssetOffchainPayments :exec | ||
UPDATE loopout_swaps_assets | ||
SET | ||
asset_amt_paid_swap = $2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add an on-conflict clause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not get into on-conflict territory, so returning an error would be okay i'd assume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this will never return an error. I meant that it could return an error if the amounts are already non-zero. It's also not super important but an extra measure that we don't update the row accidentally.
242d754
to
0f54b96
Compare
7bf86f8
to
90144f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great effort @sputn1ck, nice additions to keep track of accounting. I've left a couple of suggestions.
@@ -552,6 +552,9 @@ message SwapStatus { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be placed in a separate commit
90144f0
to
4a47df4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐐
// the swap. | ||
if request.AssetRFQRequest != nil { | ||
rfqReq := request.AssetRFQRequest | ||
if rfqReq.Expiry == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check that expiry and limit multiplier are sane? As in they're non negative etc.
@@ -29,6 +29,7 @@ require ( | |||
github.com/lightningnetwork/lnd/clock v1.1.1 | |||
github.com/lightningnetwork/lnd/queue v1.1.1 | |||
github.com/lightningnetwork/lnd/ticker v1.1.1 | |||
github.com/lightningnetwork/lnd/tlv v1.2.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be squashed with the commit before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AKTSCHUALLY, if you run go mod tidy in the prior commit it will remove this
-- name: UpdateLoopOutAssetOffchainPayments :exec | ||
UPDATE loopout_swaps_assets | ||
SET | ||
asset_amt_paid_swap = $2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this will never return an error. I meant that it could return an error if the amounts are already non-zero. It's also not super important but an extra measure that we don't update the row accidentally.
4a47df4
to
81130f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Added several comments.
96a6136
to
712b659
Compare
712b659
to
51bdf04
Compare
This PR adds a simple asset loop out. Clients are able to specify a
asset_id
during the normal loop out operation. If an asset is provided, the loop client will try to pay the swap invoice with the connected taproot-assets daemon.